package cn.sheng.mk.front.modules.user.web;

import cn.sheng.mk.entity.User;
import cn.sheng.mk.front.modules.user.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2016/5/17.
 */
@Controller
@RequestMapping("user")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("list")
    public String list(Model model){
        List<User> userList = userService.findAll();
        model.addAttribute("userList",userList);
        return "user/list";
    }
}
